package pl.softech.gpw.candles.patterns.impl2;

import pl.softech.gpw.candles.Candle;

public class CandleSeqAboveRule implements IRule {

    @Override
    public boolean match(Candle[] pattern, Candle[] candles) {
        
        for(int i = 0; i < pattern.length - 1; i++) {
            
            if(pattern[i].isAbove(pattern[i + 1]) != candles[i].isAbove(candles[i + 1])) {
                return false;
            }
            
        }
        
        return true;
    }

}
